home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
misc
/
DReg.lha
/
DReg
/
DReg_Manual
< prev
next >
Wrap
Text File
|
1994-12-15
|
8KB
|
174 lines
DReg v1.2 is Copyright © 94 of Paul Juhasz
28 Ellora Rd
Streatham
London SW16 6JF
This program is Freeware. Permission is hereby given to any individual
to copy and distribute DReg as long as no fee is charged for it apart
from the cost of media and expenses. No responsibility is accepted for
any damage to your data through use or misuse of DReg.
* * * * * * *
Preamble:
--------
DReg v1.2 is a Data Register Processor, which means that it emulates
the 68000 to help in pre-debugging. It can also work as a training
aid for would-be assembler programmers. It works the way the Motorola
68000 does, so you can see what happens when you add one byte of two
registers together, multiply, divide or negate a word.
DReg was not intended to be a calculator as such, though with a bit of
practice even that can be achieved. Where it helps is when you need to
see the results of complicated bit operations like EOR, ROXL and ASR
which one is never too sure about. Until a big red flashing requester
turns up. It is possible to do these operations in MonAm as well, but
using DReg is less complicated and much more fun, which is an essential
ingredient of good and clean programming. :-))
For any non-programmers DReg can be the difference between either
understanding of how the 68000 works or chucking the book at the wall
and re-booting with Frontier (Aaarrrgghh! I chucked Frontier at the wall,
at least until the next time:)). With a bit of experimenting you can
even get DReg to teach you how to program in fast assembler.
How-To:
------
The gadgets should be straight forward, but I will explain them, just
to be awkward and give you lots to read. From the top left:
Titlebar - Apart from the usual Close/Drag/Depth gad-
gets there is an 'Iconize' gadget. Click on
this to put DReg to sleep. The DReg icon is
by default placed in the screen-titlebar,
but can be moved anywhere. Press menubutton
(RMB) when icon active to de-iconize DReg.
Two lines of 32 '0's - the 'bits' of the two registers currently
in use. Enter values into these by clicking
on any of the 0's: they will change to 1's.
The top row represents the source and the
bottom row the destination register bits.
Two register selectors - in the right half of the panel, between the
line of 32 bits and the hexadecimal/decimal
display. They cycle through the 4 registers.
All of these (D0-D3) will keep their values
until changed either by clicking on the
bits or by an operation.
Two HEX/DEC displays - panel top far right, these represent the
eight 'nibbles' of a 32-bit long-word or
a signed decimal long, int or byte with
commas separating every thousand. These
can not be changed manually, they are only
there for display.
Status Bits display - on the right will represent the result of
any operation. The X-bit value is also
used in extended operations - see below.
Three Op-Size selectors - in the bottom left of the panel shows the
currently selected instruction size. Only
one of them can be highlighted at any one
time. Does not affect the hex display,
only the decimal.
Lots of Op-Code buttons - these take up most of the lower half of
the panel. Their meaning should be self-
evident, but any book on A68k assembler
programming will explain them in detail.
Instruction Op-Size
----------- -------
CLR - Clears destination .b .w .l
NEG - Arithmetically negates destination .b .w .l
NOT - Logically invert destination .b .w .l
AND - Logical and source -> destination .b .w .l
OR - " or " -> " .b .w .l
EOR - Exclusive or source -> destination .b .w .l
LSL - Logical shift left destination >>
by source number of bits .b .w .l
ROL - Rotate destination left by source nr of bits .b .w .l
ROXL - " " " with extend .b .w .l
LSR - \
ROR - same as last three but going right .b .w .l
ROXR - /
ASL - Arithmetic shift left (as LSL) .b .w .l
MULU - Multiply unsigned source.W * dest.W -> dest.L - .w -
MULS - " signed source.W * dest.W -> dest.L - .w -
ASR - As ASL but going right .b .w .l
DIVU - Divide unsigned dest.L / source.W -> dest.W
with remainder in upper word of destination - .w -
DIVS - Same as DIVU but signed
ADD - Add source + dest -> dest .b .w .l
EXG - Exchange source <-> destination - - .l
MOVE - Move source -> destination .b .w .l
SUB - Subtract source from destination .b .w .l
SWAP - Swap the two halves of destination - .w -
Op-Codes are executed according to size specifier, so if you use CLR
with .B, the operation will only clear a byte.
The ROXL, ROXR commands will re-use the X flag which was set by the
previous command. This should be upwardly compatible with faster
processors such as the A1200/A4000, as I have used the exec.lib
GetCC/SetSR as recommended by the RKM.
The button marked HEX controls the display in the top right of the
panel, toggle it and it will display in DECimal.
The ABOUT button is quite important too: it tells you about the legal
aspect of useage of DReg v1.2 - ©'94 and the name of the author of
this little gem. ;-)
Epilogue:
--------
DReg was written in optimized assembler, helping to debug itself as it
grew. It is as fast as Intuition can handle its complex structures.
In order to avoid the 'negative' look that WB2.xx will produce on some
1.3 icon grafix, DReg will select its colours according to the WorkBench
version it is running on. To make it easier to implement this colour-
change, being a lazy programmer myself, some gadgets use Border and
IntuiText structures, though most of them ( the 64 bits ) use Images.
The result is a trade-off of a little bit of speed for compactness and
colour flexibility.
Any contact such as bug reports, suggestions, criticisms is welcome.
In case I get enough response for any updates, I could include some
additional commands, a colour cycling button and whatever else may
seem allright at the time... Memory access ?
Written: 24th June - 22nd July, 1993, Paul Juhasz
Updates of DReg:
---------------
V1.1 - 24-28 July 93 - Iconize gadget added and program
further optimized.
V1.2 - 22-23 March 94 - Modified launch.i added to free up CLI.
See launch.i (ACC 22) for details.